//
//  SEGNewAlertView.h
//  ExcellentHome
//
//  Created by 揭婧雯 on 2017/8/23.
//  Copyright © 2017年 陈区. All rights reserved.
//

#import <UIKit/UIKit.h>


typedef void (^SEGAlertSelectIndexBlock)(NSInteger btnIndex);


@protocol SEGNewAlertViewDelegate <NSObject>

@optional
/**
 * 按钮方法
 * @author Wendy
 * @param alertView 当前SEGNewAlertView视图
 * @param buttonIndex  从0开始从左到右递加
 */
- (void)segNewAlertView:(UIView *_Nullable)alertView clickedButtonAtIndex:(NSInteger)buttonIndex;
@end

@interface SEGNewAlertView : UIView

@property (nonatomic, weak) _Nullable id <SEGNewAlertViewDelegate> delegate;

/**
 文字是否居左，默认居中
 */
@property (nonatomic, assign)BOOL labelLeft;

/**
 点击其他区域消失
 */
@property (nonatomic, assign)BOOL dismissWhenTouch;

//按钮字体颜色的修改
@property (nonatomic,strong,nullable)UIColor *nodefaultColor;

/**
 * 显示弹窗
 * @author Wendy
 * @param text  显示内容
 * @param delegate  代理
 * @param buttonTitlesArray  按钮标题数组
 */
- (void)showWithAlertText:(NSString *_Nullable)text delegate:(id _Nullable)delegate buttonTitlesArray:(NSArray <NSString *>*_Nullable)buttonTitlesArray;

/**
 * 显示弹窗（带标题）
 * @author Wendy
 * @param title 标题
 * @param text  显示内容
 * @param delegate  代理
 * @param buttonTitlesArray  按钮标题数组
 */
- (void)showWithAlertTitle:(NSString *_Nullable)title
                      text:(NSString *_Nullable)text
                 delegate:(id _Nullable)delegate
        buttonTitlesArray:(NSArray <NSString *>*_Nullable)buttonTitlesArray;

- (void)showWithAlertTitle:(NSString *_Nullable)title
              text:(NSString *_Nullable)text
         buttonTitlesArray:(NSArray <NSString *>*_Nullable)buttonTitlesArray
               actionBlock:(SEGAlertSelectIndexBlock _Nullable )block;

@end
